import { modelApi } from "/@/api/business/flowable/model";
import { message } from "ant-design-vue";
import { ref } from "vue";

export function useActReModelApi(loading) {
  const actReModel = ref();

  async function findModel(id) {
    try {
      // loading && (loading.value = true);
      let temp = await modelApi.getModel(id);
      actReModel.value = temp.data;
      // console.log('actReModel.value111:' + JSON.stringify(actReModel));
    } catch (e) {
      console.error(e);
      message.error(e?.message || '查询失败');
    } finally {
      // loading && (loading.value = false);
    }
  }

  return {
    actReModel,
    findModel
  };
}
